package com.life.goal.infrastructure.utils;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 文件读取工具类
 */
public class FileReaderUtils {

    public static void read() throws IOException {
        InputStream inputStream = new FileInputStream("D:/a.txt");
        InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        while (bufferedReader.readLine() != null) {
            String line = bufferedReader.readLine();
            System.out.println(line);
        }
        bufferedReader.close();
    }


    public static void main(String[] args) throws IOException {
        FileReaderUtils.read();
    }
}
